/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.controller;

import com.dp.dto.BaseDTO;
import com.dp.model.Articles;
import com.dp.services.IItemServices;
import com.dp.services.ItemServices;
import com.dp.utils.BaseException;
import com.dp.dto.ArticleListDTO;
import java.util.List;

/**
 *
 * @author hisik
 */
public class ArticleListController {
    
    private static final IItemServices itemServices = new ItemServices();
    
    public static List<Articles> loadArticleList(BaseDTO dto) throws BaseException {
        return itemServices.loadArticleList();
    }
    
    public static List<Articles> getArticlesByName(ArticleListDTO dto) throws BaseException {
        String articleName = dto.getArticleName();
        return itemServices.getArticlesByName(articleName);
    }
    
    public static void deleteArticleByObjid(ArticleListDTO dto) throws BaseException {
        Long objid = dto.getObjid();
        itemServices.deleteArticleByObjid(objid);
    }
}
